package com.hitqz.robot.api.business.enums;

import java.util.HashMap;

/**
 * 媒体类型
 * @author wengyx
 * @date 2024/8/7
 */
public enum MediaEnum {

    PICTURE("0", "拍照"),

    THERMOMETRY("1", "测温"),

    VIDEO("2", "视频"),

    AUDIO("3", "音频"),


    ;

    public final static HashMap<String, String> CMD_TYPE_DES = new HashMap<>();


    static {
        for (MediaEnum value : values()) {
            MediaEnum.CMD_TYPE_DES.put(value.getType(), value.getDes());
        }
    }

    private String type;

    private String des;


    MediaEnum(String flag, String des){
        this.type = flag;
        this.des = des;
    }

    public String getDes() {
        return des;
    }

    public String getType() {
        return type;
    }


    public static MediaEnum getByType(String type){
        for (MediaEnum value : values()) {
            if (value.getType().equals(type)){
                return value;
            }
        }
        return PICTURE;
    }

}
